home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Grab Bag
/
Shareware Grab Bag.iso
/
007
/
snakeoil.lqr
/
IBM.C
< prev
next >
Wrap
Text File
|
1985-07-06
|
3KB
|
89 lines
/*************************************************************************
(CI-C86) Karl L. Remmler
ibmfns.c
NOTES: These functions are intended for the IBM-PC. They are necessary
because the IBM lacks a system interface for screen display
functions. Therefore screen display functions, must be called
by system interrupts.
***************************************************************************/
struct regval { int ax,bx,cx,dx,si,di,ds,es; };
/*=========================================================================
initscr.c - initialize CRT screen */
cls()
{
struct regval reg;
reg.ax = 0x0002; /* . . .set mode to BW 80X25 */
sysint(0x10, ®, ®); /* . . . . execute interrupt */
reg.ax = 0x0500; /* . . . . .select page zero */
sysint(0x10, ®, ®);
reg.ax = 0x0600; /* . . . clear entire screen */
reg.bx = 0x0200; /* . . . . . normal display */
reg.cx = 0x0101; /* . . . . upper left corner */
reg.dx = 0x184F; /* . . . lower right corner */
sysint(0x10, ®, ®);
return(0);
}
/*========================================================================
Address Cursor */
locate(row,col)
int row,col;
{
struct regval reg;
reg.ax = 0x0200;
reg.bx = 0x0000;
reg.dx = (row <<8 ) + col;
sysint(0x10, ®, ®);
return(0);
}
/*========================================================================
Erase to end of line */
eeol()
{
struct regval sreg, rreg;
sreg.ax = 0x0300; /* read cursor position */
sreg.bx = 0x0000;
sysint(0x10, &sreg, &rreg);
sreg.cx = rreg.dx; /* erase */
sreg.ax = 0x0600;
sreg.bx = 0x0200;
sreg.dx = 0x18F4;
sysint(0x10, &sreg, &rreg);
return(0);
}
/*=======================================================================
Erase entire line */
eel()
{
struct regval sreg, rreg;
sreg.ax = 0x0300; /* read cursor postion */
sreg.bx = 0x0000;
sysint(0x10, &sreg, &rreg);
sreg.cx = rreg.dx & 0xFF00;
sreg.ax = 0x0600;
sreg.bx = 0x0200;
sreg.dx = 0x18F4;
sysint(0x10, &sreg, &rreg);
return(0);
}